﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace project4
{
    public class Table:Subject
    {
        private List<User> users = new List<User>();

        internal List<User> Users
        {
            get { return users; }
            set { users = value; }
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        public Table()
        {
            User user = new User(1, "aaa", "aaa", 1);
            users.Add(user);
            User user1 = new User(2, "bbb", "bbb", 1);
            users.Add(user1);
            User user2 = new User(3, "ccc", "ccc", 1);
            users.Add(user2);
        }

        public void Add(User user)
        {
            users.Add(user);

            Notify(user);
        }
    }
}
